<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {
      name: '小明',
      // address: '四川成都'
      address: {
        province: '四川',
        city: '成都'
      }
    }

    // const copy = {
    //   ...obj
    // }

    // console.log(copy, obj, copy === obj)
  </script>

  <script>
    const students = [
      {
        clazz: '三年级1班',
        name: '张三',
        id: 1
      },
      {
        clazz: '二年级5班',
        name: '李四',
        id: 2
      }
    ]
    const newStus = students.map(stu => {
      if (stu.id === 2) {
        stu.clazz = '六年级3班'
      }
      return stu
    })

    console.log(newStus)
  </script>

  <script>
    const array = [1, 2, 3, 4, 5]
    const newArr = array.map(item => {
      if (item >= 3) {
        item *= 5
      }
      return item
    })
    console.log(newArr)
  </script>
</body>
</html>